Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support building on Windows. #129

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

jeffdav
Copy link

@jeffdav jeffdav commented Sep 6, 2024

This PR makes it so Fuzi can be used in Swift projects on Windows.

  1. Add .build/ to .gitignore.
  2. Add CMakeLists.txt where needed to build Fuzi with CMake.
  3. Add Vendor with CMakeLists.txt to fetch and build LibXml2 on Windows, which is not available by default.
  4. Fix issue relating to the fact that a C long on Windows is 4 bytes instead of 8.
  5. CoreFoundation is not available on Windows, so replace usage of CFXxx() functions to map IANA encodings to String.Encoding with a String.Encoding extension that does the mapping.
  6. Fix a problem with libxml2 C functions wanting a mutable pointer argument.
  7. Fix issue where one member of a set of flags is a #define instead of a member of the enum proper so it is imported as the wrong type on Windows.

To build on Windows, use the Ninja generator:

cmake -S . -B build -G Ninja
cmake --build .\build\

Verified that the project still builds on MacOS with swift build.

@jeffdav
Copy link
Author

jeffdav commented Sep 17, 2024

@cezheng do you have any feedback? I'd love to get your opinion on Windows support, and I'm happy to iterate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant